% This is an R Sweave document. 
% First step is to compile through knitr. 
% Second step is to compile in XeLaTex.
% If using TeXShop on a Mac, move code/Knitr_XeLaTex to ~/Library/TeXShop/Engines
%
% These lines tell TeXShop which engine to use, require Knitr_XeLaTex engine
% !TEX TS-program = Knitr_XeLaTex
% !TEX encoding = UTF-8 Unicode

\documentclass[bibtex,nonblind]{apsr_submission}


% === graphic packages ===
\usepackage{tikz}
\usetikzlibrary{cd}
\usetikzlibrary{automata,positioning}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{decorations.pathreplacing} % for braces in diagram


% set number of floats per page
\setcounter{topnumber}{10}
\setcounter{bottomnumber}{10}
\setcounter{totalnumber}{10}


\usepackage{float} % here for H placement parameter

% Allows table notes for kableExtra package in R (just average marginal effects table in references)
\usepackage{tabu}
\usepackage{threeparttable}
\usepackage{threeparttablex}


% === Better underlines in tikz diagram
\usepackage[outline]{contour}

\usepackage{ulem}
\normalem % use classical emph

\newcommand \myul[4]{%
  \begingroup%
  \renewcommand \ULdepth {#1}%
  \renewcommand \ULthickness {#2}%
  \contourlength{#3}%
  \uline{\phantom{#4}}\llap{\contour{white}{#4}}%
  \endgroup%
}


%\usepackage{caption}
%%%%%%%%%%%%%%%%%%%%%%%%%%
% APSR bib modification
% http://merkel.zoneo.net/Latex/natbib.php
% remove comma between Author, Year
\bibpunct{(}{)}{;}{a}{}{;}
% Also, search and replace all citet for citealt to remove parentheses
% Finally, experiment with various apsr.bst files including apsr2006.bst and apsr_fs.bst

%% Example alternative options with everything the opposite of the above: (DO NOT USE AUTOWC WITH BIBLATEX; the word count will be greatly over-reported)
% \documentclass[biblatex,nonblind,singlespace,twocolumn]{apsr_submission}

\title{Replication Code: Agenda Seeding: How 1960s Black Protests Moved Elites, Public Opinion and Voting} 


\author{Omar Wasow}
       {Princeton University}
       {Assistant Professor, Department of Politics, Princeton University, 130 Corwin Hall, Princeton, NJ 08544,  \mbox{\href{mailto:owasow@princeton.edu}{owasow@princeton.edu}},  \url{http://omarwasow.com} 
       }
       

\thanks{My thanks to Jennifer Hochschild, Gregg Lee Carter, Paul Peterson, Susan Olzak, Keith Darden, Andrew Eggers,  Ryan Enos, Elena Llaudet, Jen Brea, Chris Achen, Rachel Stein, Leanne Powner, and Ali Valenzuela for their advice and suggestions. This research was also generously supported by the National Science Foundation Graduate Research Fellowship, The W. E. B. Du Bois Institute, and The Project on Justice, Welfare \& Economics. I also thank Jamal Johnson, Liam Glass and Risa Gelles-Watnick for superb research assistance.}

%% These are used for the headers
\runningtitle{Agenda Seeding}
\runningauthor{Wasow} % 4 + Authors, Author One et al. 

%% Useful packages
\usepackage{amsmath}
\usepackage{graphicx}

%% If you are using a custom figure or table environment from a package and it's not getting framed, add \makeframedenv{MyFigure} in the preamble, where the custom figure environment is \begin{MyFigure}...\end{MyFigure}.
%% Currently table, table*, figure, figure*, longtable, supertabular, sidewaystable and sidewaysfigure will be automatically framed.

%% Handy for setting wide tables/figures in landscape
\usepackage{pdflscape}

%% Recent LaTeX distributions should be able to automatically convert .eps to .pdf; but if this isn't happening, try loading the epstopdf package manually
% \usepackage{epstopdf}

%% Just to add some dummy text
\usepackage{lipsum}

% === spacing / scaling commands
\def \sspacing {1}
\def \hspacing {1.5}
\def \dspacing {1.7}
\def \mapscale {.8}


% === tables ===
%\usepackage{tabularx}
\usepackage{multirow}
%\usepackage{booktabs}
\usepackage{array}
\newcolumntype{L}[1]{>{\raggedright\arraybackslash}m{#1}}

% https://stackoverflow.com/questions/33208777/how-to-set-both-column-width-and-text-alignment-in-align-argument-of-xtable
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}p{#1}}

% add small amounts of space to table rows with "struts"
% https://tex.stackexchange.com/questions/50352/inserting-a-small-vertical-space-in-a-table
\newcommand\T{\rule{0pt}{2.8ex}}       % Top strut
\newcommand\B{\rule[-1.4ex]{0pt}{0pt}} % Bottom strut
\newcommand\Bsmall{\rule[-0.7ex]{0pt}{0pt}} % Bottom strut smaller



% === dcolumn package ===
\usepackage{dcolumn}
\newcolumntype{.}{D{.}{.}{-1}}
\newcolumntype{d}[1] {D{.}{.}{#1}}

\usepackage{comment}

%%% Use \addbibresource{...} if using BibLaTeX
% \addbibresource{sample.bib}

<<load_externalized_code, include = FALSE>>=
library(knitr)
library(here) # use for all read., read_, load(), save(), source()


knitr::opts_chunk$set(
  echo    = FALSE,
  message = FALSE,
  warning = FALSE,
  error   = FALSE,
  include = TRUE
)

read_chunk(here("code/APSR_protests3_1_rep.R"))
@

<<load_packages, include = FALSE>>=
@

<<setup_internal, include = FALSE, cache=FALSE>>=

set.seed(12345678)


  cache.var     <- TRUE
  cache.panel   <- TRUE
  cache.summary <- TRUE
  cache.elite   <- TRUE
  cache.match   <- TRUE
  cache.map     <- TRUE
  cache.inst    <- TRUE
  cache.text    <- FALSE
  cache.granger <- FALSE
  cache.sim     <- FALSE
  cache.app     <- FALSE
  cache.autoreg <- FALSE
  cache.frame   <- FALSE
  cache.sweep   <- FALSE


cache.false <- FALSE # for temporarily turning off chunk-level caching but easier to find and reverse

@

<<set_global_parameters, include = FALSE>>=
@


<<load_minor_functions, include = FALSE>>=
@


<<load_processed_protest_data_updated, include = FALSE>>=
@



<<load_ggplot_themes>>=
@



<<plm_calc_prep, cache=FALSE >>=
@


<<word_functions, include = FALSE>>=
@


<<load_custom_fuctions>>=
@

<<load_state_maps, include = FALSE>>=
@



\totalwordcount{-}
\begin{document}

\begin{frontmatter}
\begin{abstract}
How do stigmatized minorities advance agendas when confronted with hostile majorities? Elite theories of influence posit marginal groups exert little power. I propose the concept of \textrm{agenda seeding} to describe how activists use methods like disruption to capture the attention of media and overcome political asymmetries. Further, I hypothesize protest tactics influence how news organizations frame demands. Evaluating black-led protests between 1960 and 1972, I find nonviolent activism, particularly when met with state or vigilante repression, drove media coverage, framing, Congressional speech and public opinion on civil rights. Counties proximate to nonviolent protests saw presidential Democratic vote share among whites increase 1.3-1.6\%. Protester-initiated violence, by contrast, helped move news agendas, frames, elite discourse and public concern toward ``social control.'' In 1968, using rainfall as an instrument, I find violent protests likely caused a 1.6-7.9\% shift among whites towards Republicans and tipped the election. Elites may dominate political communication but hold no monopoly.

\end{abstract}
\end{frontmatter}

\section{Introduction}


\section{What explains temporal and geographic variation on issues of race in the 1960{s}? \label{sec:puzzle}}

<<mostimportantproblem1950, fig.width=9, fig.height=5, fig.pos="H", fig.cap="Public Opinion on the `Most Important Problem,' 1950 to 1979",  cache=cache.var >>=
@


\section{Elite and pluralistic theories of influence \label{sec:litreview}}

\section{Agenda seeding \label{sec:leading} }

%:Diagram

\setstretch{1}


\begin{figure}[h]
\begin{center}

\begin{tikzpicture}[scale=.9]
{\footnotesize
\node (event) [text width=1.5cm] at (0, 0) {Subordinate \\ group \\ activists \\ seek to \\ elevate \\ concerns}; 
%
\node (protest_nv) [text width=1.4cm] at (3.6, 2) {Protesters \\ nonviolent};
\node (protest_v) [text width=1.4cm] at (3.6, -2) {Protesters \\ violent};
%
\node (pnv_state_nv) [text width=2.4cm] at (7.5, 3) {State nonviolent \\ \textit{March on Wash.}};
\node (pnv_state_v) [text width=2.4cm] at (7.5, 1) {State violent \\ \textit{Selma, AL}};
%
\node (pv_state_nv) [text width=2.4cm] at (7.5, -1) {State nonviolent \\ \textit{Albany, GA}};
\node (pv_state_v) [text width=2.4cm] at (7.5, -3) {State violent \\ \textit{Watts uprising}};
%
\node (pnv_media) [text width=3cm] at (11.5, 2) { Agenda setting and issue framing for ``rights''};
\draw[decoration={brace,raise=-14pt,mirror},decorate,line width=.75pt] ([yshift=-15pt]pnv_media.south west) -- ([yshift=15pt]pnv_media.north west); 
\draw[decoration={brace,raise=+5pt,mirror},decorate,line width=.75pt] ([yshift=-15pt]pnv_media.south east) -- ([yshift=15pt]pnv_media.north east);
%
\node (pv_media) [text width=3cm] at (11.5, -2) { Agenda setting and issue framing for \\ ``riots''  and ``disorder''};
\draw[decoration={brace,raise=-14pt,mirror},decorate,line width=.75pt] ([yshift=-15pt]pv_media.south west) -- ([yshift=15pt]pv_media.north west);
\draw[decoration={brace,raise=+5pt,mirror},decorate,line width=.75pt] ([yshift=-15pt]pv_media.south east) -- ([yshift=15pt]pv_media.north east);

%
\node (pnv_politics) [text width=3cm] at (15.75, 2) {Move median elites and masses toward \\ subordinate group-aligned coalition};
%\draw[decoration={brace,raise=-13pt,mirror},decorate,line width=.75pt] ([yshift=-15pt]pnv_politics.south west) -- ([yshift=15pt]pnv_politics.north west);
%
\node (pv_politics) [text width=3cm] at (15.75, -2) {Move median elites and masses toward \\ dominant group-aligned coalition};
%\draw[decoration={brace,raise=-13pt,mirror},decorate,line width=.75pt] ([yshift=-9pt]pv_politics.south west) -- ([yshift=9pt]pv_politics.north west);
%
\node (protest_action) [text width=4cm] at (1.5, 4.5) {\textbf{1. Subordinate group}: \\ agenda seeding \\ {\myul{5pt}{0.5pt}{1.5pt}{ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  } } }; 
%\node (protest_action) [text width=3cm] at (5, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{Staging}}; 
\node (state_action) [text width=3cm] at (7.8, 4.5) {\textbf{2. State}: \\ counter-action  \\ {\myul{5pt}{0.5pt}{1.5pt}{\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \  } } }; 
\node (media_effects) [text width=3.6cm] at (12, 4.5) {\textbf{3. Media}: \\ agenda setting, \\ {\myul{5pt}{0.5pt}{1.5pt}{issue framing} } }; 
\node (political_effects) [text width=3.75cm] at (16, 4.5) {\textbf{4. Elites \& masses}: \\ elite discourse, {\myul{5pt}{0.5pt}{1.5pt}{public opinion, voting} } }; 
%
%\node (protest_action) [text width=3cm] at (1, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{1. Subordinate group: Agenda seeding \& frame construction}}; 
%%\node (protest_action) [text width=3cm] at (5, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{Staging}}; 
%\node (state_action) [text width=2.5cm] at (7.8, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{2. State counter-action}}; 
%\node (media_effects) [text width=2cm] at (12.1, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{3. Media effects}}; 
%\node (political_effects) [text width=2.5cm] at (16.6, 4.25) {\myul{3pt}{0.5pt}{1.5pt}{4. Political effects}}; 


\draw[->] (event.0) -- (protest_nv.200) ;
\draw[->] (event.0) -- (protest_v.160);
%
\draw[->] (protest_nv.0) to node[above]{\textit{i}} (pnv_state_nv.190) ;
\draw[->] (protest_nv.0) to node[below]{\textit{ii}} (pnv_state_v.170);
%
\draw[->] (protest_v.0) to node[above]{\textit{iii}} (pv_state_nv.190) ;
\draw[->] (protest_v.0) to node[below]{\textit{iv}} (pv_state_v.170);
%
}
\end{tikzpicture}
\end{center}
\caption{Model of How Activist Agenda Seeding Influences Media and Politics \label{fig:theory_diagram}}
\end{figure}

\setstretch{\dspacing}



\section{Empirical strategy \label{sec:empirical}}



\section{Data and variables of interest \label{sec:data}}


\subsection*{Protests}

<<load_last_summary_stats>>=
# for N in summary stats table, load last compile's matched N
load(file = here("data/summary_stats.Rdata"), verbose = FALSE)

@


\begin{table}[!h]
\centering
\caption{Summary Statistics for Matched County-level Data.\label{tab:summary_statistics_all}}

\resizebox{\linewidth}{!}{
\begin{tabular}{lrrrrrrrrrrrr}
%\toprule
\multicolumn{1}{c}{ } & \multicolumn{4}{c}{DCA (nonviolent)} & \multicolumn{4}{c}{DCA (violent)} & \multicolumn{4}{c}{Carter (violent)} \\
\cmidrule(l{3pt}r{3pt}){2-5} \cmidrule(l{3pt}r{3pt}){6-9} \cmidrule(l{3pt}r{3pt}){10-13}
\multicolumn{1}{c}{ } & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} \\
\cmidrule(l{3pt}r{3pt}){2-3} \cmidrule(l{3pt}r{3pt}){4-5} \cmidrule(l{3pt}r{3pt}){6-7} \cmidrule(l{3pt}r{3pt}){8-9} \cmidrule(l{3pt}r{3pt}){10-11} \cmidrule(l{3pt}r{3pt}){12-13}
 & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD)\\
\midrule
\input{summary_stats_revised_extract_matched.tex}
\addlinespace
\multicolumn{1}{l}{N } & \multicolumn{2}{c}{\Sexpr{summary_nv64[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_nv64[14,3]}} & \multicolumn{2}{c}{\Sexpr{summary_v68[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_v68[14,3]}} & \multicolumn{2}{c}{\Sexpr{summary_v268[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_v268[14,3]}} \\
%\bottomrule
\end{tabular}}
\end{table}
%TC:endignore



\subsection*{Voting}

\subsection*{News coverage} 

\subsection*{Public opinion}

\subsection*{Elite discourse}

\subsection*{Control Variables}

\section{Results \label{sec:results}}

\subsection*{Did protests cause changes in voting behavior?}



<<protests_to_panel_function, include = FALSE,  cache = cache.panel>>=
@

<<plm_pdata_calc_updated, include = FALSE,  cache = cache.panel>>=
@


<<plm_models, include = FALSE, eval = TRUE, cache = cache.panel>>=
@

<<plm_calc_save, include = FALSE, cache = cache.panel>>=
@





<<summary_stats, cache=cache.summary>>=
@

<<plm_matching, cache=cache.match>>=
@

<<summary.stats.plm, echo = FALSE, cache = cache.summary>>=
@


\subsection*{Are protests exogenous to voting?}




<<grob_functions, echo=FALSE, cache=cache.panel>>=
@

<<load_spatial_panel_models, echo=FALSE>>=
load(here::here("data", "spatial_panel_multi2.Rdata") )
@


<<plm_plots_test, echo=FALSE,  fig.width=12, fig.height=6, fig.pos="h!", fig.cap="Panel Models of Effect of Protest on Change in Presidential Vote Share, 1964-1972", cache=cache.panel>>=
@

\clearpage

\subsection*{Did violent protests in April 1968 cause a decline in Democratic vote share?}



<<diff.plot.function,  results='hide', fig.keep='none', include = FALSE, cache=cache.var>>=
@



<<formulas_ols_iv_models, include = FALSE>>=
@

<<ols_models, include = FALSE >>=
@


<<iv_models_no_matching_updated, include = FALSE>>=
@

<<iv_cbps_matching_updated, include = FALSE>>=
@

<<iv_calc_robust_models_updated, include = FALSE>>=
@


<<rain.instrument.se.calc,  results='hide', fig.keep='none', include = FALSE, cache=cache.inst>>=
@



<<choro2_calc, eval=TRUE, cache=cache.map>>=
@






\subsection*{Instrumental variable models}


<<ftests, echo=FALSE, cache=cache.panel>>=
@

<<prep_iv_p_values, include = FALSE>>=
@


<<iv.plot1-1, fig.width=12, fig.height=5, fig.pos="h!", fig.cap="IV Models of Effect of Violent Protests in April 1968 on White Vote Share", cache=cache.inst >>=
@
\clearpage


\subsection{What were the political consequences of violent protests? \label{sec:consequences}}


<<mlk_counterfactual_sim_load_data, include = FALSE, echo = FALSE>>=
@

<<mlk_counterfactual_sim, include = FALSE, eval = TRUE, cache=cache.sim>>=
@


<<mlk_counterfactual_stats, echo=FALSE, results='asis', eval = TRUE, cache=cache.sim>>=
@



<<counterfactual_summary, include = FALSE, results='asis', eval = TRUE, cache=cache.sim>>=
@



<<table.evs, results='asis', echo=FALSE, eval = TRUE, cache=cache.sim>>=
@
\clearpage


<<choro_electoralvote_counter_calc, include = FALSE, eval = TRUE, cache=cache.map>>=
@

<<choro_electoralvote_counter,  fig.cap="Counterfactual Choropleth Map of the 1968 U.S. Presidential Election", echo=FALSE, warning=FALSE, message=FALSE, error=FALSE, fig.width=14, eval = TRUE, cache=cache.map>>=
@
\clearpage



\section{Mechanisms \label{sec:mechanisms}}
\subsection*{Are activists leading or following elite agendas?} 




<<load_all_data, eval=TRUE, echo=FALSE, warning=FALSE, message=FALSE, error=FALSE, cache=cache.frame>>=
@



<<trend_plot_setup, eval=TRUE, cache=cache.var>>=
@

<<protests_nonviolent_news_opinion_civil_rights, eval=TRUE, fig.width=8.5, fig.height=4.5, fig.pos="h!", fig.cap="Nonviolent Protest Activity, Headlines \\& Public Opinion on `Civil Rights,' by Month",  cache=cache.var>>= 
@
\clearpage


<<protests_violent_news_opinion_riots, eval=TRUE, fig.width=8.5, fig.height=4.5,  fig.pos="h!", fig.cap="Violent Protest Activity, Headlines on `Riots' and Public Opinion on `Social Control', by Month",  cache=cache.text>>=
@




<<congress_riots_violent_protests_plot_load_data, include = FALSE>>=
@

<<congress_riots_violent_protests_plot,  fig.width=9, fig.height=4.5, fig.pos="h!", fig.cap="Violent Protest Arrests and Congressional Speech on `Riots,' 1964-1972, by Week",  warning=FALSE, cache=cache.elite>>=
@
\clearpage


\subsection*{Who's leading whom?}



<<granger.functions, cache=cache.granger>>=
@






\subsection*{Do protest tactics shape media issue frames?}



<<framing_load_packages_data_local, echo=FALSE, eval=TRUE, cache=FALSE>>=
@

<<framing_lda_analysis_load_data>>=
@

<<framing_lda_analysis, eval=TRUE, results='hide', cache=cache.frame>>=
@

<<framing_tf_freq_analysis, eval=TRUE, cache=cache.frame>>=
@




<<framing_ratio_terms, eval=TRUE,  fig.height=6, fig.width=10, fig.pos="h!", fig.cap="Ratio of Term Frequencies in Articles About Protests Coded as Protester Nonviolent or Protester Violent", cache=cache.frame >>=
@



\subsection{What about police violence?}

<<load_dca_for_nyt_models, include = FALSE>>=
@

<<nyt_poisson_models>>=
@


<<nyt_marginal_effects_plots, echo = FALSE, fig.width=9, fig.height=3, fig.pos="H", fig.cap="Marginal Effects of Police and Protester Violence on \\textit{New York Times} Coverage", message = FALSE>>=
@
\clearpage


\subsection*{Do police tactics shape media issue frames?}

<<framing_case_2_vs_3_load_data>>=
@

<<framing_case_2_vs_3, fig.height=6, fig.width=10, fig.pos="h!", fig.cap="Ratio of Term Frequencies in Articles (Protesters Nonviolent and State Violent / Protesters Violent and State Nonviolent)", cache=FALSE>>=
@
\clearpage






<<reload_lmtest_local>>=
library("lmtest")
@


<<granger_calc_load_data, include = FALSE>>=
@

<<granger_calc, echo=F, warning=F, error=F, cache=cache.granger>>=
@


<<reload_libraries_local, include=FALSE>>=
opts_chunk$set(echo=FALSE)

library(lmtest)
library(tidyr)
library(dplyr)
library(stringr)
library(imputeTS)
library(xtable)
library(rlang)
library(forecast)
library(lubridate)
library(purrr)
@


<<load_data_granger_local, cache=cache.granger>>=
load(here::here("data", "all_data_attica_congress_no_nyt.Rdata") )
@

<<load_granger_functions, echo=FALSE>>=
@



<<set_up_granger_df, echo=FALSE>>=
@


<<set_up_granger_df2, echo=FALSE, cache=cache.granger>>=
@


<<set_up_granger_df3, echo=FALSE, cache=cache.granger>>=
@



<<set_up_granger_df4, echo=FALSE, cache=cache.granger >>=
@





\section{Discussion \label{sec:discussion} }


\section{Conclusion \label{sec:conclusion}} 




\clearpage
\setcounter{page}{1}


\section*{Appendix \label{sec:appendix}}
\setstretch{\hspacing}



\setcounter{section}{0}


\section{Summary Statistics for Unmatched County-level Data.\label{sec:summary_statistics_unmatched} }



\begin{table}[!h]
\centering
\caption{Summary Statistics for Unmatched County-level Data.\label{tab:summary_statistics_unmatched} }

\resizebox{\linewidth}{!}{
\begin{tabular}{lrrrrrrrrrrrr}
%\toprule
\multicolumn{1}{c}{ } & \multicolumn{4}{c}{DCA (nonviolent)} & \multicolumn{4}{c}{DCA (violent)} & \multicolumn{4}{c}{Carter (violent)} \\
\cmidrule(l{3pt}r{3pt}){2-5} \cmidrule(l{3pt}r{3pt}){6-9} \cmidrule(l{3pt}r{3pt}){10-13}
\multicolumn{1}{c}{ } & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} & \multicolumn{2}{c}{Controls} & \multicolumn{2}{c}{Treated} \\
\cmidrule(l{3pt}r{3pt}){2-3} \cmidrule(l{3pt}r{3pt}){4-5} \cmidrule(l{3pt}r{3pt}){6-7} \cmidrule(l{3pt}r{3pt}){8-9} \cmidrule(l{3pt}r{3pt}){10-11} \cmidrule(l{3pt}r{3pt}){12-13}
 & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD) & Mean & (SD)\\
\midrule
\input{summary_stats_revised_extract_unmatched.tex}
\addlinespace
\multicolumn{1}{l}{N } & \multicolumn{2}{c}{\Sexpr{summary_nv64_unmatched[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_nv64_unmatched[14,3]}} & \multicolumn{2}{c}{\Sexpr{summary_v68_unmatched[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_v68_unmatched[14,3]}} & \multicolumn{2}{c}{\Sexpr{summary_v268_unmatched[14,1]}} & \multicolumn{2}{c}{\Sexpr{summary_v268_unmatched[14,3]}} \\
%\bottomrule
\end{tabular}}
\end{table}



\newpage


\section{Scatter plot of black-led protest activity, 1960 to 1972 \label{sec:protestsbyyear} }

As can be seen in Figure~\ref{fig:protestsbyyear}, black-led nonviolent protest activity reached unprecedented levels in the early to mid-1960s and then, toward the latter half of the decade, more than 750 events escalated to include protester-initiated violence. At the same time, public opinion and policy preferences among the white majority on issues related to race swung rapidly across time and region, from indifference to concern about civil rights to anxiety about ``social control.''  


<<echo=FALSE>>=
# restore regular plotting function
knit_hooks$set(plot = regular_plot)
@

 <<protestsbyyear,  fig.pos="h!", results = 'hide', fig.cap="When Did the 1960s Black-Led Nonviolent and Violent Protest Activity Peak?", fig.width=9, fig.height=5,  cache=cache.app>>=
@


\clearpage


\section{Choropleth plot of protest activity, April 1968 \label{sec:choro_mlk} }


<<choro2, fig.width=10, eval=TRUE, fig.pos="h!", fig.cap="Choropleth Map of Estimated Exposure to Black-Led Violent Protests Following King's Assassination on April~4th, 1968. \\label{fig:choro_countyexposure}", cache=cache.map>>=
@

Figure~\ref{fig:choro_countyexposure} presents a choropleth plot of the counties within 100 miles of a violent protest that included at least 10 arrests.

\clearpage




\section{Regression Tables \label{sec:regressiontables} }




\setstretch{\sspacing}





\begin{table}[h!]
\renewcommand{\arraystretch}{0.85}% Tighter

{\centering

\caption{Panel Models of Protests on County-level Democratic Presidential Vote Share, 1964-1972} 


<<plm.lag.white.table, echo=FALSE, results='asis', cache=cache.panel>>=
@


\label{panelpres_nv_v_lag_white}
}
\vspace{.5em}

\begin{flushleft}
\footnotesize{Models (1) through (4) use data from DCA and the protest `treatment' is calculated as a function of the estimated number of participants in the protest. Models (5)~and~(6) uses data from \citet{carter1986black} and the protest `treatment' is calculated as a function of estimated number of people arrested in the violent protest. Models (1), (3)~and~(5) use data from all counties. Models (2), (4)~and~(6) only include counties that are at least 90\% white. All models use county fixed effects (not shown) and robust and clustered standard errors at the county level to address serial correlation.}
\end{flushleft}

\end{table}%

\setstretch{\dspacing}





\setstretch{\sspacing}

\begin{table}[h!]
\renewcommand{\arraystretch}{0.85}% Tighter

{\centering
%
\caption{Matched County Panel Models of Protests on Democratic Presidential Vote Share, 1964-1972} 
%\linespread{1.5}

<<plm.lag.white.match.table, results='asis', cache=cache.panel>>=
@

\label{panelpres_nv_v_lag_white_match}
}
\vspace{.5em}

\begin{flushleft}
\footnotesize{Models (1) through (4) use data from DCA and the protest `treatment' is calculated as a function of the estimated number of participants in the protest. Models (5)~and~(6) uses data from \citet{carter1986black} and the protest `treatment' is calculated as a function of estimated number of people arrested in the violent protest. Models (1), (3)~and~(5) use a matched subset of all counties. Models (2), (4)~and~(6) use matched subsets of counties that are at least 90\% white. All models use county fixed effects (not shown) and robust and clustered standard errors at the county level to address serial correlation.}
\end{flushleft}

\end{table}%

\setstretch{\dspacing}

\clearpage



\input{spatial_panel_multi_table.tex}



\setstretch{\sspacing}


<<load_pdata1, include = FALSE>>=
@


<<setup_formula_functions>>=
@

<<setup_reg_params>>=
@

<<matched_data1, cache=cache.match>>=
@


<<custom_stargazer_function>>=
@

<<pdata_tables2, eval = TRUE, results = 'asis'>>=
@









\setstretch{\sspacing}

\begin{table}[htp]
\renewcommand{\arraystretch}{0.85}% Tighter

{\centering

\caption{OLS Models of April 1968 Protests on Democratic Vote Share} 


<<table.ols.match.white, echo=FALSE, message=FALSE, warning=FALSE, error=FALSE, results='asis', cache=cache.match>>=
@

\label{tab:olswls.white}
}
\vspace{.5em}

\begin{flushleft}
\footnotesize{Models (1)~and~(2) use ordinary least squares without matching or weights. Models (3)~and~(4) use Mahalanobis distance matching. Models (5)~and~(6) use Covariate Balance Propensity Score weights. Models (1), (3)~and~(5) use data from all available counties. Models (2), (4)~and~(6) only include counties that are at least 90\% white. All models use April 1968 violent protest data from \citet{carter1986black}. }
\end{flushleft}

\end{table}%

\setstretch{\dspacing}

\clearpage







\setstretch{\sspacing}

\begin{table}[htp]
\renewcommand{\arraystretch}{0.85}% Tighter

{\centering

\caption{Instrumental Variable Models of April 1968 Protests on  Democratic Vote Share} 



<<iv_table3_prep, include = FALSE>>=
@


<<iv_table3, eval=TRUE, results='asis', cache=cache.inst >>=
@

\label{tab:rainfall.instrument.white}
}
\vspace{.5em}

\begin{flushleft}
\footnotesize{Each model uses county-level cumulative rainfall in April 1968 to instrument for violent protest activity in counties that are at least 90\% white. Models (1)~and~(2) use rainfall before King is assassinated as a placebo test. Models (3)~and~(4) use rainfall in the week that follows Dr. King's  the assassination in which about 95\% of the protests occur.  Models (5)~and~(6) offer a second placebo test by using rainfall in the period of April~11-30 when only five percent of protests occur. Models (2), (4) and (6) use data matched with CBPS weights as calculated in Table~\ref{tab:olswls.white}. All models use April 1968 violent protest data from \citet{carter1986black}. Models exclusively use 90\% white counties as partial $F$-tests indicate rainfall is a strong instrument for protests in that subset. As indicated in the paper, %XXXXX
 the $F$-statistics for the three tests on 90\% white counties without CBPS weights, respectively, are \Sexpr{round(ftest.simple,2)}, \Sexpr{round(ftest.robusthetero,2)}, \Sexpr{round(ftest.robustcluster,2)}, and, with CBPS weights, \Sexpr{round(ftest.simple.weights,2)}, \Sexpr{round(ftest.robusthetero.weights,2)}, and \Sexpr{round(ftest.robustcluster.weights,2)}. Partial $F$-tests suggest rainfall is a weak instrument for protests across all counties. }


\end{flushleft}

\end{table}%


\setstretch{\dspacing}

\clearpage




\setstretch{\sspacing}

\begin{table}[h!]
%\renewcommand{\arraystretch}{0.85}% Tighter

{\centering

\caption{Poisson GLM Models of Police- and Protester-Initiated Violence on Change in \textit{New York Times} Coverage of Black-Led Protests \label{tab:nyt_glm} } 


<<nyt_poisson_out_table, results = 'asis'>>=
@

} % end center

\vspace{.5em}

\begin{minipage}{6in}
    \small
    {\textit{Note}: Regression table of estimated effects of violence by police and violence by protesters on three measures of coverage of black protest events in the \textit{New York Times}. Poisson regression used to model count data. Predictors in each model were police violence and protester violence along with fixed effects for  event year. Fixed effects not shown and results robust to their exclusion. Number of articles is per event. Number of paragraphs is per article. Page number reflects distance from front page (page one).  Data source: DCA. }

\end{minipage}
    

\end{table}%



<<nyt_marginal_effects_police_protester_violence, results = 'asis'>>=
@


\setstretch{\dspacing}

\clearpage




\section{Black party identification,  1936-2012 \label{sec:blackpartyid} }


<<blackpartyid, fig.pos="h!", fig.cap="Scatter Plot of Black Party Identification, 1936 to 2012.  Lines Drawn with Loess Smoothing Function. Data From: \\citep{bositis2012blacks}.", echo=FALSE, fig.width=8, fig.height=5, warning=FALSE, error=FALSE,  message=FALSE, cache=cache.app>>= 
@



\clearpage






\section{Granger causality tests \label{sec:granger} }



\setlength{\intextsep}{3pt}

\setstretch{\sspacing}

<<granger_bulk, results='asis', echo=FALSE, cache=cache.granger >>=
@

\setstretch{\dspacing}




\section{Augmented Dickey-Fuller tests for cointegration \label{sec:cointegration}}


<<cointegration_setup, results = 'hide', cache=cache.granger >>=
@



<<print_cointegration_table, results='asis', cache=cache.granger >>=
@





\clearpage







\section{Balance Plot before and after CBPS Weighting \label{sec:balanceplot}}


<<balanceplot.calc, include=FALSE,  cache=cache.app >>=
@

<<cbps_balanceplot, fig.pos="h!", fig.cap="Balance Plot of the Absolute Difference of Standardized Means Between the Original, Unweighted Covariates (Dark Circles) and the CBPS Weighted Covariates (Open Circles). All Covariates Show an Improvement in Balance After CBPS Weighting.", fig.height=5, fig.width=8, cache=cache.app >>=
@


\clearpage

\section{Balance plots before and after matching with panel data \label{sec:balanceplot_matching}}

<<panel_balance_plot_nv, fig.pos="h!", fig.cap="Covariate Balance for Panel Data with Nonviolent Protest `Treatment' Using Nearest Neighbor Propensity Score Matching with a Caliper. Four Variables Above Were Identified by Prior Literature as Being Predictive of Protest Activity.", echo=FALSE, fig.height=8, fig.width=8, cache=cache.panel >>=
@

\vspace{.5in}
\ \\ 

<<panel_balance_plot_v_local, fig.pos="h!", fig.cap="Covariate Balance for Panel Data with Violent Protest `Treatment' Using Nearest Neighbor Propensity Score Matching with a Caliper. Four Variables Above Were Identified by Prior Literature as Being Predictive of Protest Activity.", echo=FALSE, fig.height=8, fig.width=8, cache=cache.panel >>=

theme_set(theme_cowplot())


love.plot(bal.tab(v.match), 
     var.names=var.names.new) + 
     ggtitle("Covariate balance, panel data with violent protest 'treatment'")

@


\clearpage





\end{document}




